package cn.lyq.card.ui.message

import cn.lyq.card.base.SimpleVM
import cn.lyq.card.data.model.PageInfo


class MessageVM : SimpleVM() {

    val pageSize = 20


    fun getSys(page: Int, type: Int) = simpleEmit {
        repository.userService.getNotice(page, pageSize, type)
    }

    fun readAll() = simpleEmit {
        repository.userService.setAllNoticeRead()
    }

    fun read(id: Int) = simpleEmit {
        repository.userService.setNoticeRead(id)
    }
}